package com.gzq.factorymethod.practice01;

import java.lang.reflect.InvocationTargetException;

public class BaGuaLuFactory implements IBaGuaLu {

	@Override
	public <T extends IProductHuman> T create(Class<T> c) {
		T newInstance = null;
		try {
			newInstance = c.getDeclaredConstructor().newInstance();
		} catch (InstantiationException | IllegalAccessException
				| IllegalArgumentException | InvocationTargetException
				| NoSuchMethodException | SecurityException e) {
			e.printStackTrace();
		}
		return newInstance;
	}

}
